

<%@ page import="org.tailor.Tailor" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'tailor.label', default: 'Tailor')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${tailorInstance}">
            <div class="errors">
                <g:renderErrors bean="${tailorInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${tailorInstance?.id}" />
                <g:hiddenField name="version" value="${tailorInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="tailorID"><g:message code="tailor.tailorID.label" default="Tailor ID" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'tailorID', 'errors')}">
                                    <g:textField name="tailorID" value="${fieldValue(bean: tailorInstance, field: 'tailorID')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="tailorName"><g:message code="tailor.tailorName.label" default="Tailor Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'tailorName', 'errors')}">
                                    <g:textField name="tailorName" value="${tailorInstance?.tailorName}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="login"><g:message code="tailor.login.label" default="Login" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'login', 'errors')}">
                                    <g:textField name="login" value="${tailorInstance?.login}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="password"><g:message code="tailor.password.label" default="Password" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'password', 'errors')}">
                                    <g:passwordField name="password" value="${tailorInstance?.password}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address01"><g:message code="tailor.address01.label" default="Address01" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'address01', 'errors')}">
                                    <g:textField name="address01" value="${tailorInstance?.address01}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address02"><g:message code="tailor.address02.label" default="Address02" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'address02', 'errors')}">
                                    <g:textField name="address02" value="${tailorInstance?.address02}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="city"><g:message code="tailor.city.label" default="City" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'city', 'errors')}">
                                    <g:textField name="city" value="${tailorInstance?.city}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="contactFName"><g:message code="tailor.contactFName.label" default="Contact FN ame" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'contactFName', 'errors')}">
                                    <g:textField name="contactFName" value="${tailorInstance?.contactFName}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="contactLName"><g:message code="tailor.contactLName.label" default="Contact LN ame" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'contactLName', 'errors')}">
                                    <g:textField name="contactLName" value="${tailorInstance?.contactLName}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="contactTitle"><g:message code="tailor.contactTitle.label" default="Contact Title" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'contactTitle', 'errors')}">
                                    <g:textField name="contactTitle" value="${tailorInstance?.contactTitle}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="country"><g:message code="tailor.country.label" default="Country" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'country', 'errors')}">
                                    <g:textField name="country" value="${tailorInstance?.country}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="discountType"><g:message code="tailor.discountType.label" default="Discount Type" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'discountType', 'errors')}">
                                    <g:textField name="discountType" value="${tailorInstance?.discountType}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="email"><g:message code="tailor.email.label" default="Email" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'email', 'errors')}">
                                    <g:textField name="email" value="${tailorInstance?.email}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="fax"><g:message code="tailor.fax.label" default="Fax" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'fax', 'errors')}">
                                    <g:textField name="fax" value="${fieldValue(bean: tailorInstance, field: 'fax')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="notes"><g:message code="tailor.notes.label" default="Notes" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'notes', 'errors')}">
                                    <g:textField name="notes" value="${tailorInstance?.notes}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="paymentMethods"><g:message code="tailor.paymentMethods.label" default="Payment Methods" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'paymentMethods', 'errors')}">
                                    <g:textField name="paymentMethods" value="${tailorInstance?.paymentMethods}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="phone"><g:message code="tailor.phone.label" default="Phone" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'phone', 'errors')}">
                                    <g:textField name="phone" value="${fieldValue(bean: tailorInstance, field: 'phone')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="postalCode"><g:message code="tailor.postalCode.label" default="Postal Code" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'postalCode', 'errors')}">
                                    <g:textField name="postalCode" value="${fieldValue(bean: tailorInstance, field: 'postalCode')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="regions"><g:message code="tailor.regions.label" default="Regions" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'regions', 'errors')}">
                                    <g:select name="regions.id" from="${org.tailor.Regions.list()}" optionKey="id" value="${tailorInstance?.regions?.id}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="shirt"><g:message code="tailor.shirt.label" default="Shirt" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'shirt', 'errors')}">
                                    
<ul>
<g:each in="${tailorInstance?.shirt?}" var="s">
    <li><g:link controller="shirt" action="show" id="${s.id}">${s?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="shirt" action="create" params="['tailor.id': tailorInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'shirt.label', default: 'Shirt')])}</g:link>

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="state"><g:message code="tailor.state.label" default="State" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'state', 'errors')}">
                                    <g:textField name="state" value="${tailorInstance?.state}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="tailorDescription"><g:message code="tailor.tailorDescription.label" default="Tailor Description" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'tailorDescription', 'errors')}">
                                    <g:textField name="tailorDescription" value="${tailorInstance?.tailorDescription}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="typeShirt"><g:message code="tailor.typeShirt.label" default="Type Shirt" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'typeShirt', 'errors')}">
                                    <g:textField name="typeShirt" value="${tailorInstance?.typeShirt}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="url"><g:message code="tailor.url.label" default="Url" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: tailorInstance, field: 'url', 'errors')}">
                                    <g:textField name="url" value="${tailorInstance?.url}" />
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
